﻿using System.Diagnostics;
using UnityEngine;
using System.IO;
using Debug = UnityEngine.Debug;

namespace LFromeWork
{
    public class EditorUtils
    {
        public static void ExplorerFolder(string folder)
        {
            folder = string.Format("\"{0}\"", folder);
            switch (Application.platform)
            {
                case RuntimePlatform.WindowsEditor:
                    Process.Start("Explorer.exe", folder.Replace('/', '\\'));
                    break;
                case RuntimePlatform.OSXEditor:
                    Process.Start("open", folder);
                    break;
                default:
                    Debug.LogError(string.Format("Not support open folder on '{0}' platform.",
                        Application.platform.ToString()));
                    break;
            }
        }
    }
}
